# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Orivej Desh <smpuj@bk.ru>

pkgname=libunibreak
pkgver=5.1
pkgrel=1
pkgdesc="An implementation of the line breaking algorithm as described in Unicode 5.2.0 Standard Annex 14, Revision 24"
arch=("loong64" "x86_64")
url="https://github.com/adah1972/libunibreak/"
license=("custom:zlib/libpng")
depends=()
replaces=('liblinebreak')
source=("$pkgname-$pkgver.tar.gz::https://github.com/adah1972/libunibreak/archive/libunibreak_${pkgver//./_}.tar.gz")
sha256sums=('d59878d82c84a60b592940a8e1a264f0a9714f0a9a8868b099846f780d9dc167')

build() {
  cd "$srcdir/libunibreak-libunibreak_${pkgver//./_}"
  ./bootstrap
  ./configure --prefix=/usr
  make
}

package() {
  cd "$srcdir/libunibreak-libunibreak_${pkgver//./_}"
  make DESTDIR="$pkgdir" install
  rm -f "$pkgdir"/usr/lib/*.a
  install -Dm644 LICENCE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
